package Win;

import Manger.CreateUIL;
import User.CreateUILogin;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class LogWin extends JFrame implements MouseListener {
    JLabel title = new JLabel("中医体质管理系统",JLabel.CENTER);
    JButton user = new JButton("用户登录");
    JButton manager = new JButton("管理员登陆");
    int width=500,height=500;
    public LogWin(){
        setVisible(true);
        setTitle("中医体质管理系统");
        setLayout(null);
        setLocationRelativeTo(null);
        setVisible(true);
        setBounds(300,300,width,height);
        title.setFont(new Font("微软雅黑",Font.BOLD,20));
        title.setBounds(width/4,height/8,width/2,height/4);
        getContentPane().add(title);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        user.addMouseListener(this);
        user.setBounds(width/4,height/3,width/2,height/10);
        getContentPane().add(user);
        manager.addMouseListener(this);
        manager.setBounds(width/4,height/2,width/2,height/10);
        getContentPane().add(manager);
    }
    public void mouseClicked(MouseEvent e){
        Object obj = e.getSource();
        if(obj==user){
            CreateUILogin createUILogin = new CreateUILogin("images/用户背景.jpg","中医体质管理系统");
            dispose();
        }
        if(obj==manager){
            CreateUIL createUILogin = new CreateUIL("images/用户背景.jpg","中医体质管理系统");
            dispose();
        }
    }
    public void mousePressed(MouseEvent e){}
    public void mouseReleased(MouseEvent e){}
    public void mouseEntered(MouseEvent e){}
    public void mouseExited(MouseEvent e){}
}
